home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 2
/
Atari Mega Archive CD - Volume 2.iso
/
minix
/
up1510b.tgz
/
up1510b
/
include
/
dirent.h
< prev
next >
Wrap
C/C++ Source or Header
|
1990-07-23
|
1KB
|
41 lines
/* The <dirent.h> header file is for POSIX. It is used by the opendir(),
* readdir(), writedir(), and related procedure calls.
*/
#ifndef _DIRENT_H
#define _DIRENT_H
/* DIRBUF must in general be larger than the filesystem buffer size. */
#define _DIRBUF 2048 /* buffer size for fs-indep. dirs */
#define _DIR_MAGIC 19997 /* arbitrary number for marking DIRs */
/* The DIR structure is used for all the directory operations. */
typedef struct {
int dd_fd; /* file descriptor */
int dd_loc; /* offset in block */
int dd_size; /* amount of valid data */
int dd_magic; /* magic number to recognize DIRs */
char *dd_buf; /* -> directory block */
} DIR; /* stream data from opendir() */
struct dirent { /* data from getdents()/readdir() */
long d_ino; /* inode number of entry */
off_t d_off; /* offset of disk directory entry */
unsigned short d_reclen; /* length of this record */
char d_name[1]; /* name of file plus a 0 byte */
};
/* Function Prototypes. */
#ifndef _ANSI_H
#include <ansi.h>
#endif
_PROTOTYPE( int closedir, (DIR *_dirp) );
_PROTOTYPE( int getdents, (int _fildes, char *_buf, unsigned _nbyte) );
_PROTOTYPE( DIR *opendir, (char *_dirname) );
_PROTOTYPE( struct dirent *readdir, (DIR *_dirp) );
_PROTOTYPE( void rewinddir, (DIR *_dirp) );
#endif /* _DIRENT_H */